<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateUserInfoTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('user_info', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('user_id',false)->default(0)->index()->comment('用户id');
            $table->string('true_name',60)->nullable()->comment('姓名');
            $table->unsignedTinyInteger('sex',false)->default(0)->comment('性别 0=保密 1=男 2=女');
            $table->date('birthday')->nullable()->comment('生日');
            $table->string('id_card',20)->nullable()->comment('身份证号');
            $table->unsignedTinyInteger('user_type',false)->default(0)->comment('身份类型 1=学生 2=应届 3=在职 4=离职');
            $table->string('house_province_name',30)->nullable()->comment('居住地省份');
            $table->string('house_city_name',30)->nullable()->comment('居住地城市');
            $table->string('house_district_name',30)->nullable()->comment('居住地地区');
            $table->string('house_address',150)->nullable()->comment('居住地址');
            $table->string('person_sign',200)->nullable()->comment('个性签名');
            $table->string('life_photo',200)->nullable()->comment('生活照');
            $table->timestamps();
            $table->softDeletes();
            $table->engine="InnoDb";
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('user_info');
    }
}
